package com.hspedu.string_;

public class StringExercise01 {
    public static void main(String[] args) {
        String a = "hsp";// a指向常量池的 "hsp"
        String b = new String("hsp");// b指向堆中对象
        System.out.println(a.equals(b));//T
        System.out.println(a==b);//F
        // b.intern() 返回常量池地址
        System.out.println(a==b.intern());//T
        System.out.println(b==b.intern());//F

    }
}
